package com.itheima.dao;

import com.github.pagehelper.Page;
import com.itheima.pojo.CheckGroup;
import com.itheima.pojo.Setmeal;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 32338
 * @date 2024-05-03 20:13:39
 * @description
 */
@Mapper
public interface SetmealDao {

    @Select("select checkgroup_id from t_setmeal_checkgroup where setmeal_id = #{setmealId}")
    List<Integer> findGroupIdBySetmealId(Integer setmealId);

    void add(Setmeal setmeal);

    @Delete("delete from t_setmeal where id=#{id}")
    void deleteById(Integer id);

    void edit(Setmeal setmeal);
    @Select("select * from t_setmeal where id=#{id}")
    Setmeal findById(Integer id);

    Page<CheckGroup> page(String value);
}
